<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>LastElement</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">LastElement()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>LastElement</b></font>(List())</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Change the current list element to the last list element. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>List()</i></td>
<td width="90%"> 
 
The name of your list variable, created with the <a href="../reference/newlist.html">NewList</a> function. 
You must include the brackets after the list name. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the address of the data in the last list element if successful and zero 
if there if there are no elements in the list. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; An example of simple usage</font>
  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Numbers</font>.w()

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 5
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 8

<font color="#3A3966">  LastElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  MessageRequester</font>("Information", "Last element value is "+<font color="#3A3966">Str</font>(<font color="#3A3966">Numbers</font>()), <font color="#924B72">#PB_MessageRequester_OK</font>)


  <font color="#3A3966">; An example which uses the return-value</font>
  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Numbers</font>.w()

  <b><font color="#3A3966">If</font></b> <font color="#3A3966">LastElement</font>(<font color="#3A3966">Numbers</font>()) &lt;&gt; 0
<font color="#3A3966">    MessageRequester</font>("Information", "Last element value is "+<font color="#3A3966">Str</font>(<font color="#3A3966">Numbers</font>()), <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">    MessageRequester</font>("Information", "List is empty", <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">EndIf</font></b>

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 5
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 8

  <b><font color="#3A3966">If</font></b> <font color="#3A3966">LastElement</font>(<font color="#3A3966">Numbers</font>()) &lt;&gt; 0
<font color="#3A3966">    MessageRequester</font>("Information", "Last element value is "+<font color="#3A3966">Str</font>(<font color="#3A3966">Numbers</font>()), <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">    MessageRequester</font>("Information", "List is empty", <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">EndIf</font></b>


  <font color="#3A3966">; An example which is only for advanced users</font>
  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Numbers</font>.w()

<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 5
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">  Numbers</font>() = 8

  *Element.Word =<font color="#3A3966"> LastElement</font>(<font color="#3A3966">Numbers</font>())
  <b><font color="#3A3966">If</font></b> *Element
<font color="#3A3966">    MessageRequester</font>("Information", "Last element value is "+<font color="#3A3966">Str</font>(*Element\w), <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">    MessageRequester</font>("Information", "List is empty", <font color="#924B72">#PB_MessageRequester_OK</font>)
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="firstelement.html">FirstElement()</a>, <a href="previouselement.html">PreviousElement()</a>, <a href="nextelement.html">NextElement()</a>, 
<a href="selectelement.html">SelectElement()</a>, <a href="listindex.html">ListIndex()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=insertelement.html>InsertElement()</a> - <a href="index.html">List Index</a> - <a href="listindex.html">ListIndex()</a> -&gt;<br><br>

</body></html>